<div id="contact" class="inner-tabs-panel">
    <div class="inner-content"> 
        <div class="panel">
        <div class="panel-heading">
            <div class="panel-title"> Contact <code class="help">Slug : #contact</code></div>
        </div>  

        <div class="panel-body wo-flag">
             <div class="form-group">
                <div class="slider">
                    <input type="checkbox" id="enable-contact" class="toggle-settings" name="theme_options[contact][enable]" value="1" <?php echo  (isset($aContact['enable']) && !empty ($aContact['enable']) ) ? 'checked' : ''; ?>>
                    <label class="form-label" for="enable-contact">Enable Contact</label>
                </div>
            </div>
        </div>

        <div class="panel-body">
            <h4>Paralax</h4>
            <div class="form-group">
                <?php $contactParallax = isset($aContact['parallax']) && !empty($aContact['parallax']) ? $aContact['parallax'] : WO_ADMIN_IMG  . 'no-img.jpg'; ?>
                <div class="image-wrap">
                    <span><img src="<?php echo $contactParallax; ?>" width="350"></span>
                </div>
                <br>
                <a class="btn btn-white upload-img" data-insertlink=".wo-insert-link" data-append=".image-wrap">Get image</a>
                <input class="insertlink" type="hidden" value="<?php echo  isset($aContact['parallax']) ? $aContact['parallax'] : ""; ?>" name="theme_options[contact][parallax]">
            </div>
        </div>

        <div class="panel-body">

               
                <div class="form-group">
                    <label class="form-label">Title</label>
                    <!-- <span class="help">[e.g. "Our Service"]</span> -->
                    <div class="controls">
                        <input type="text" class="form-control" name="theme_options[contact][title]" value="<?php echo isset($aContact['title']) ? stripslashes($aContact['title']) : "";  ?>">
                    </div>
                </div>

                <div class="form-group">
                    <label class="form-label">Short description</label>
                    <div class="controls">
                        <input type="text" class="form-control" name="theme_options[contact][short_description]" value="<?php echo isset($aContact['short_description']) ? stripslashes($aContact['short_description']) : "";  ?>">
                    </div>
                </div>
                <div class="form-group">
                    <label class="form-label">Description</label>
                    <div class="controls">
                        <textarea class="form-control" name="theme_options[contact][description]"><?php echo isset($aContact['description']) ? stripslashes($aContact['description']) : "";  ?></textarea>
                    </div>
                </div>

        </div>

        <div class="panel-body">
            <h4>Google Map</h4>
            <div class="form-group">
                <label class="form-label">Position</label>
                <div class="controls">
                    <?php
                          // if (!is_plugin_active('leaflet-maps-marker/leaflet-maps-marker.php'))
                          // {
                          //     echo '<span class="help">To embbed Google map into your website, need installed <code> leaflet map marker </code></span>';
                          // }else{
                              ?>
                              <!-- <input type="text" name="theme_options[contact][section2][googlemap_shortcode]" placeholder="Insert Map Marker Shortcode" value="<?php echo isset($aContact['section2']['googlemap_shortcode']) ? htmlentities(stripslashes($aContact['section2']['googlemap_shortcode'])) : "";  ?>" /> -->
                              <?php
                          // }
                     ?>
                     <input type="text" name="theme_options[contact][googlemap][longitude]" value="<?php echo isset($aContact['googlemap']['longitude']) ? $aContact['googlemap']['longitude'] : '';  ?>" placeholder="Longitude"> <span style="position: relative; top: 9px; margin: 0 10px;"> X </span><input type="text" name="theme_options[contact][googlemap][latitude]" value="<?php echo isset($aContact['googlemap']['latitude']) ? $aContact['googlemap']['latitude'] : '';  ?>" placeholder="Latitude">

                </div>
            </div>


            <div class="form-group">
                <label class="form-title">Marker</label>
                <div class="controls">
                    <input type="text" class="form-control" name="theme_options[contact][googlemap][marker_title]" placeholder="Title" value="<?php echo isset($aContact['googlemap']['marker_title']) && !empty($aContact['googlemap']['marker_title']) ? stripslashes($aContact['googlemap']['marker_title']) : ''; ?>">
                </div>
                <div class="controls">
                    <?php $markerImage = isset($aContact['googlemap']['marker_image']) && !empty($aContact['googlemap']['marker_image']) ? $aContact['googlemap']['marker_image'] : WO_ADMIN_IMG  . 'marker-map.png';
                         $realmarkerImage = isset($aContact['googlemap']['marker_image']) && !empty($aContact['googlemap']['marker_image']) ? $aContact['googlemap']['marker_image'] : WO_ADMIN_IMG  . 'marker-map.png';
                     ?>
                    <div class="image-wrap">
                        <span><img src="<?php echo $markerImage; ?>" width="45"></span>
                    </div>
                    <br>
                    <a class="btn btn-white upload-img" data-insertlink=".wo-insert-link" data-append=".image-wrap">Get image</a>
                    <input class="insertlink" type="hidden" value="<?php echo  $realmarkerImage; ?>" name="theme_options[contact][googlemap][marker_image]">
                </div>
            </div>

        </div>

        <div class="panel-body">
            <h4>Contact Form</h4>
            <div class="form-group">
                    <label class="form-label">Title</label>
                    <div class="controls">
                        <input type="text" class="form-control" name="theme_options[contact][ctf7_title]" value="<?php echo isset($aContact['ctf7_title']) ? stripslashes($aContact['ctf7_title']) : "";  ?>">
                    </div>
            </div>
            <div class="form-group">
                <label class="form-label">Contact Form 7</label>
                <div class="controls">
                    <?php
                    if (!is_plugin_active('contact-form-7/wp-contact-form-7.php'))
                    {
                        echo '<span class="help">You need active<code> Contact Form 7 </code></span>';
                    }else{
                        $contactForm7 = get_posts( array('post_type'=>'wpcf7_contact_form') );

                        if ( !empty($contactForm7) && !is_wp_error($contactForm7) ) :
                        ?>
                    <!--     <input type="text" name="theme_options[contact][section3][contactform7_shortcode]" placeholder="Insert Contact Form7 Shortcode" value="<?php echo isset($aContact['section3']['contactform7_shortcode']) ? htmlentities(stripslashes($aContact['section3']['contactform7_shortcode'])) : "";  ?>" /> -->
                    <?php
                            echo '<select name="theme_options[contact][section3][contactform7_shortcode]">';
                            foreach ($contactForm7  as $contactForm) : setup_postdata($contactForm);
                                $checked = isset($aContact['section3']['contactform7_shortcode']) && ($aContact['section3']['contactform7_shortcode'] == $contactForm->ID) ? 'selected' : '';
                                ?>
                                <option value="<?php echo $contactForm->ID ?>" <?php echo $checked; ?>><?php echo get_the_title($contactForm->ID) ?></option>
                                <?php
                            endforeach;
                            echo '</select>';
                        else :
                            echo 'Opp! You  haven\'t had any post yet. Click <a target="_blank" href="'.admin_url('admin.php').'?page=wpcf7"></a> to create some';
                        endif;
                    }
                    ?>
                </div>
            </div>
        </div>

        <div class="panel-body">
            <h4>Contact Info</h4>
            <div class="form-group">
                <label class="form-label">Contact Info</label>
                <div class="controls">
                    <?php
                    $PostMetaContactDetail = $this->wo_get_custom_post_content('qva_contact_details');


                    if ( empty($PostMetaContactDetail) )
                    {
                        ?>

                        <p>Haven't  yet any post created.
                            <a  class="help" href="<?php echo admin_url('edit.php'); ?>?post_type=qva_contact_details">Create some</a>
                        </p>

                    <?php
                    }else
                    {
                    ?>
                    <select name="theme_options[contact][contact_info]" >
                        <?php
                        foreach ( $PostMetaContactDetail as $k => $postContactInfo ) : setup_postdata($postContactInfo);
                            if (isset($aContact['contact_info']) && !empty($aContact['contact_info']) && $aContact['contact_info'] == $postContactInfo->ID )
                            {
                                $selected = 'selected';
                            }else{
                                if ($k == 0)
                                {
                                    $selected = 'selected';
                                }else{
                                    $selected = '';
                                }
                            }
                            ?>
                            <option value="<?php echo $postContactInfo->ID; ?>" <?php echo $selected ?> ><?php echo $postContactInfo->post_title; ?></option>
                        <?php
                        $selected="";
                        endforeach;wp_reset_postdata();
                        
                        ?>
                    </select>
                       <?php } ?>
                </div>
            </div>
        </div>
        </div>
    </div>
</div>